import Vue from 'vue'
import Router from 'vue-router'
import Index from './Index.vue'
import PersonalCenter from '../components/Personal Center.vue';
import Setup from '../components/Setup.vue';
import BasicInfo from '../components/BasicInfo.vue';
import HealthRecord from '../components/Health-Record.vue';
import MedicalService from '../components/Medical-Service.vue';
import Feedback from '../components/Feedback.vue';
import examination from '../components/Examination.vue';
import look from '../components/Look.vue';
import paybaoxiao from '../components/Paybaoxiao.vue';
import illnesshistory from '../components/Illnesshistory.vue';
import Record from '../components/Record.vue';
import Systeminfo from '../components/Systeminfo.vue';
import Forum from '@/components/Forum.vue';  
import DiseaseForum from '@/components/DiseaseForum.vue'; // 引入疾病论坛通用模板组件
import AboutUs from '../components/AboutUs.vue'
import Login from '../components/Login.vue';
import Register from '../components/Register.vue'
import ForgotPassword from '../components/ForgotPassword.vue';
import AI_helper from '../components/AI_helper.vue';
import UserAgreement from '../components/UserAgreement.vue';
import Privacy from '../components/Privacy.vue';
import MyPosts from '../components/MyPosts.vue';
import MyCollections from '../components/MyCollections.vue';

Vue.use(Router)

export default new Router({
  routes: [
    {
      path:'/',
      name:'Login',
      component:Login
    },
    {
      path:'/Register',
      name:'Register',
      component:Register
    },
    {
      path:'/ForgotPassword',
      name:'ForgotPassword',
      component:ForgotPassword
    },
    {
      path: '/Index',
      name: 'Index',
      component: Index,
    },
    {
      path: '/PersonalCenter',
      name: 'PersonalCenter',
      component: PersonalCenter,
      redirect: '/basic-info',
      children:[
        {
          path: '/basic-info',
          name: 'BasicInfo',
          component: BasicInfo
        },
        {
          path: '/health-record',
          name: 'HealthRecord',
          component: HealthRecord,
          redirect: '/Record',
          children:[
            {
              path: '/examination',
              name: 'Examination',
              component: examination
            },
            {
              path: '/look',
              name: 'Look',
              component: look
            },
            {
              path: '/paybaoxiao',
              name: 'Paybaoxiao',
              component: paybaoxiao
            },
            {
              path: '/illnesshistory',
              name: 'Illnesshistory',
              component: illnesshistory
              
            },
            {
              path: '/Record',
              name: 'Record',
              component: Record
            },
          ]
        },
        {
          path: '/Systeminfo',
          name: 'Systeminfo',
          component: Systeminfo
          
        },
        {
          path: '/medical-service',
          name: 'MedicalService',
          component: MedicalService
        },
        {
          path: '/feedback',
          name: 'Feedback',
          component: Feedback
        },
        {
          path: '/Setup',
          name: 'Setup',
          component: Setup
        }
      ]
    },
    {
      path:'/AboutUs',
      name:'AboutUs',
      component:AboutUs
    },
    {
      path:'/AI_helper',
      name:'AI_helper',
      component:AI_helper
    },
    {
      path:'/Privacy',
      name:'Privacy',
      component:Privacy
    },
    {
      path:'/UserAgreement',
      name:'UserAgreement',
      component:UserAgreement
    },
    {
      path:'/Forum',
      name:'Forum',
      component:Forum
    },
    {
    path: '/forum/:diseaseName',
    name: 'DiseaseForum',
    component: DiseaseForum
  },

  {
    path: '/my-posts',
    name: 'MyPosts',
    component: MyPosts
  },

  {
    path: '/MyCollections',
    name: 'MyCollections',
    component: MyCollections
  },

  ],
  mode:'history',
})
